{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Logistic Regression With Linear Boundary Demo\n",
    "\n",
    "_Source: 🤖[Homemade Machine Learning](https://github.com/trekhleb/homemade-machine-learning) repository_\n",
    "\n",
    "> ☝Before moving on with this demo you might want to take a look at:\n",
    "> - 📗[Math behind the Logistic Regression](https://github.com/trekhleb/homemade-machine-learning/tree/master/homemade/logistic_regression)\n",
    "> - ⚙️[Logistic Regression Source Code](https://github.com/trekhleb/homemade-machine-learning/blob/master/homemade/logistic_regression/logistic_regression.py)\n",
    "\n",
    "**Logistic regression** is the appropriate regression analysis to conduct when the dependent variable is dichotomous (binary). Like all regression analyses, the logistic regression is a predictive analysis. Logistic regression is used to describe data and to explain the relationship between one dependent binary variable and one or more nominal, ordinal, interval or ratio-level independent variables.\n",
    "\n",
    "Logistic Regression is used when the dependent variable (target) is categorical.\n",
    "\n",
    "For example:\n",
    "\n",
    "- To predict whether an email is spam (`1`) or (`0`).\n",
    "- Whether online transaction is fraudulent (`1`) or not (`0`).\n",
    "- Whether the tumor is malignant (`1`) or not (`0`).\n",
    "\n",
    "> **Demo Project:** In this example we will try to classify Iris flowers into tree categories (`Iris setosa`, `Iris virginica` and `Iris versicolor`) based on `petal_length` and `petal_width` parameters."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# To make debugging of logistic_regression module easier we enable imported modules autoreloading feature.\n",
    "# By doing this you may change the code of logistic_regression library and all these changes will be available here.\n",
    "%load_ext autoreload\n",
    "%autoreload 2\n",
    "\n",
    "# Add project root folder to module loading paths.\n",
    "import sys\n",
    "sys.path.append('../..')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Import Dependencies\n",
    "\n",
    "- [pandas](https://pandas.pydata.org/) - library that we will use for loading and displaying the data in a table\n",
    "- [numpy](http://www.numpy.org/) - library that we will use for linear algebra operations\n",
    "- [matplotlib](https://matplotlib.org/) - library that we will use for plotting the data\n",
    "- [logistic_regression](https://github.com/trekhleb/homemade-machine-learning/blob/master/homemade/logistic_regression/logistic_regression.py) - custom implementation of logistic regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Import 3rd party dependencies.\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# Import custom logistic regression implementation.\n",
    "from homemade.logistic_regression import LogisticRegression"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Load the Data\n",
    "\n",
    "In this demo we will use [Iris data set](http://archive.ics.uci.edu/ml/datasets/Iris).\n",
    "\n",
    "The data set consists of several samples from each of three species of Iris (`Iris setosa`, `Iris virginica` and `Iris versicolor`). Four features were measured from each sample: the length and the width of the sepals and petals, in centimeters. Based on the combination of these four features, [Ronald Fisher](https://en.wikipedia.org/wiki/Iris_flower_data_set) developed a linear discriminant model to distinguish the species from each other."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>SETOSA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>SETOSA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>SETOSA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>SETOSA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>SETOSA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>5.4</td>\n",
       "      <td>3.9</td>\n",
       "      <td>1.7</td>\n",
       "      <td>0.4</td>\n",
       "      <td>SETOSA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.4</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.3</td>\n",
       "      <td>SETOSA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.4</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>SETOSA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>4.4</td>\n",
       "      <td>2.9</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>SETOSA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.1</td>\n",
       "      <td>SETOSA</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sepal_length  sepal_width  petal_length  petal_width   class\n",
       "0           5.1          3.5           1.4          0.2  SETOSA\n",
       "1           4.9          3.0           1.4          0.2  SETOSA\n",
       "2           4.7          3.2           1.3          0.2  SETOSA\n",
       "3           4.6          3.1           1.5          0.2  SETOSA\n",
       "4           5.0          3.6           1.4          0.2  SETOSA\n",
       "5           5.4          3.9           1.7          0.4  SETOSA\n",
       "6           4.6          3.4           1.4          0.3  SETOSA\n",
       "7           5.0          3.4           1.5          0.2  SETOSA\n",
       "8           4.4          2.9           1.4          0.2  SETOSA\n",
       "9           4.9          3.1           1.5          0.1  SETOSA"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Load the data.\n",
    "data = pd.read_csv('../../data/iris.csv')\n",
    "\n",
    "# Print the data table.\n",
    "data.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Plot the Data\n",
    "\n",
    "Let's take two parameters `petal_length` and `petal_width` for each flower into consideration and plot the dependency of the Iris class on these two parameters."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEXCAYAAACpuuMDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzt3Xl4VeW1x/HvIiBBBKkEC4JIBAEZNGjqhANK61AoWK+oaK1oW3rrtdqrpYPSihW1DtfZW0sdkCsXFScsVKwXaYtW0DAosyMKSBVxYBQhWfePsxNzTk6SfXLmnN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NNQvbA1E2PqJROosMlGTkaxsxViYiWHO72BXzCR6u3ZE2pNQfTsJIolh9OjRAPTs2bNmyu0lS5Zw3HHH1exz4okn0rVrV5599tma/g1N351NO3bsoKysjM6dO/Phhx/yrW99K9shSYalYxGbMMcMWz+RSJ1FJmoykpWtGAszMXy+LrH2kEaOHMmcOXNYtGgR27dvr/NXezxz587lvffeo6ysjKuvvrqmvXr67muuuYa7776bJ554Imq//v3789prr1FZWRl7yJppu2vbvHkz77//Pr169YobR8+ePXn//ffZsmVLVHvt6b6rnzG89957uDv33HNPo+9Pmpd0LGIT5phh6ycSqbPIRE1GsrIVY2Emhr27JdYe0l577cWJJ57IRRddVPPXfxgtW7bk9ttvZ8qUKXzyySesXr2aN998s2Z79dTatfXs2ZPy8nKuvvpqPJgIcc2aNcyaNYuhQ4eyfft2pkyZAkRu/VxxxRWMGTOGPffcM24Mbdu25YILLuDyyy+vSTZTpkxh+/btUetCAOy5557ceeed/Nd//Re7d++OdzhppsIueNOqRStaWstG+4WtgQhbP5FInUUmajKSla0YCzMxDP0ttIpZe6FVm0h7kkaPHs1rr70WlRhinzFUP2SurUuXLowePZp77rmHrVu3csEFF9CvXz8OOeQQVqxYwYQJE+rsc9999/Hhhx/Sq1cvBgwYwJgxY9h3330xM5566immT5/OQQcdRO/evSkuLub666+v2XfOnDl069at5uvll1/mhhtuoLi4mN69e3PQQQcxffp0nnrqKSLrLUUbNGgQhxxyiJYPLTDDDhzGhGMm0KVtFwyjS9suTDx2ItcOvjaq7drB1zLx2ImN9ptwzIRQD1HjnTfevmH7Jdo3W7IVY8FOu53qUUkSTdNui+QeTbvdmEPOUiIQyVHpqFnIJbked+EmBhHJSemoWcgl+RB3YT5jEJGclY6ahVySD3ErMYhITklHzUIuyYe4lRhEJKeko2Yhl+RD3EoMIpJT0lGzkEvyIW4lhhQ58cQTee6556Labr/9dk477TQGDBgAwN/+9jf23ntvysrK6Nu3Lz//+c+j+s+ePZsjjjiCvn37UlZWxtlnn837778PwJgxY3j88ccBGDJkCOXlX404q6ioYMiQITXnGD58eM22Z599lvLycvr168egQYO44ooros5ZVlbGOeeck5pfgkgKpKNmIZfkQ9walZQiDU27ffHFF9e0HXfcccycOZMdO3YwaNAgvvvd7zJ48GCWLVvGT3/6U5555pma8f/PPPMMa9asoXv37nXO99FHH/Hss89y2mmn1RvTsmXLuOSSS5g1axZ9+/alsrKSSZMm1WxfuXIllZWVzJs3j23bttG2bdtU/CpEkjbswGGhC99y6QM1rFyPu2ATQ6rHESc67XabNm0oKytj/fr1ANx4441ceeWVUUVhDc1eOm7cOK677roGE8NNN93EVVddRd++fYHI/Es/+clParZPmzaN888/n5UrVzJjxgzOPffchN6zSKIysZZDrtUI5Fo8YRRkYkjHOOLa026PHDkyatrteD799FPefPNNjj/+eCAyVXbsraWGHH300Tz11FPMnTuXdu3axe2zbNmyOreOanv00Ud5/vnnWbVqFXfddZcSg6RVvP/vwq7bEK9fPtQ25Fo8YRXkM4Z0jSOub9rt2ubNm8ehhx5K165dOeWUU+jcue5IhE2bNlFWVkbv3r255ZZb6j3f+PHjmThxYpNiraiooKSkhO7duzN06FAWL17MJ5980qRjiYQR7/+7sOs2xOuXD7UNuRZPWAWZGNI1jjjMtNvHHXccr732GsuXL+f++++vWSqzf//+LFq0CICOHTuyZMkSxo4dy9atW+s930knncSOHTuYP39+3O39+/evM/12tWnTprFq1Sp69OhBz5492bx5c52pvUVSKRNrOeRajUCuxRNWQSaGdI0jTmTa7dLSUn71q19x4403AvCLX/yC6667jpUrV9b02b59e6PnHD9+PDfddFPcbePGjeP666/njTfeAKCqqop7772XqqoqHnvsMZYuXcqaNWtYs2YNM2bM0EypklaZWMsh12oEci2esAoyMaRzHHG8abfr8+///u/84x//YM2aNQwcOJA77riD73//+/Tp04fBgwezcuXKRu/7f/vb36ZTp05xtx1yyCHcfvvtjB49moMPPpgBAwbwzjvvMG/ePLp27cp+++1X0/f4449nxYoVbNiwIbE3LBJSvP/vwq7bEK9fPtQ25Fo8YRXstNv5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15rZBKA4wfMbkcWDRtezfWfwvZKm/T+1s9bP9R1jB+Hirn2sqlqvq2KOW8xXVxkiUXQrSfJBd/tq4fZzifw1vRroVN1uZq3MrH/QZwvQLvi5+sP04+C5QL2jkBowHxhsZr2Cc7U1s96N7PMScFbQ/2Tga3FiS8RKoFfw82qgi5l9Izh+OzNLNCH1Jk+n0Jb0U2KQfLCayOphK4l8wP7B3b8k8iF/o5m9BiwBjgn6TwbuDW7L7AT+RORD8Dng1URP7u4biYx0mmZmrxO5jdS3kd2uAU42s2XAKOBfwBZ330TkltSyWg+fw5hFZMp4gvd+NnBX8N6fJ4GroOD5TC8iz0pE6tC025LTLLKe9czgwXHeMLPWQKW77w6uav4QLF2azDFfBIYnu4i9mX0XOMzdf5PMcaT50jMGkfToDjxmZi2AL4EfpeCYVwTHTSoxEPn//r+SD0eaK10xSMEzs6eA0pjmX7r7c9mIRyTblBhERCSKHj6LiEgUJQYREYmixCAiIlGUGEREJMr/A3XldMGr8dFdAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# List of suppported Iris classes.\n",
    "iris_types = ['SETOSA', 'VERSICOLOR', 'VIRGINICA']\n",
    "\n",
    "# Pick the Iris parameters for consideration.\n",
    "x_axis = 'petal_length'\n",
    "y_axis = 'petal_width'\n",
    "\n",
    "# Plot the scatter for every type of Iris.\n",
    "for iris_type in iris_types:\n",
    "    plt.scatter(\n",
    "        data[x_axis][data['class'] == iris_type],\n",
    "        data[y_axis][data['class'] == iris_type],\n",
    "        label=iris_type\n",
    "    )\n",
    "\n",
    "# Plot the data.    \n",
    "plt.xlabel(x_axis + ' (cm)')\n",
    "plt.ylabel(y_axis + ' (cm)')\n",
    "plt.title('Iris Types')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Prepara the Data for Training\n",
    "\n",
    "Let's extract `petal_length` and `petal_width` data and form a training feature set and let's also form out training labels set."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Get total number of Iris examples.\n",
    "num_examples = data.shape[0]\n",
    "\n",
    "# Get features.\n",
    "x_train = data[[x_axis, y_axis]].values.reshape((num_examples, 2))\n",
    "# Get labels.\n",
    "y_train = data['class'].values.reshape((num_examples, 1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Init and Train Logistic Regression Model\n",
    "\n",
    "> ☝🏻This is the place where you might want to play with model configuration.\n",
    "\n",
    "- `polynomial_degree` - this parameter will allow you to add additional polynomial features of certain degree. More features - more curved the line will be.\n",
    "- `max_iterations` - this is the maximum number of iterations that gradient descent algorithm will use to find the minimum of a cost function. Low numbers may prevent gradient descent from reaching the minimum. High numbers will make the algorithm work longer without improving its accuracy.\n",
    "- `regularization_param` - parameter that will fight overfitting. The higher the parameter, the simplier is the model will be.\n",
    "- `polynomial_degree` - the degree of additional polynomial features (`x1^2 * x2, x1^2 * x2^2, ...`). This will allow you to curve the predictions.\n",
    "- `sinusoid_degree` - the degree of sinusoid parameter multipliers of additional features (`sin(x), sin(2*x), ...`). This will allow you to curve the predictions by adding sinusoidal component to the prediction curve."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Theta 1</th>\n",
       "      <th>Theta 2</th>\n",
       "      <th>Theta 3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>SETOSA</th>\n",
       "      <td>30.291853</td>\n",
       "      <td>-8.404206</td>\n",
       "      <td>-12.313125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>VERSICOLOR</th>\n",
       "      <td>-2.858904</td>\n",
       "      <td>1.546523</td>\n",
       "      <td>-3.107221</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>VIRGINICA</th>\n",
       "      <td>-45.349540</td>\n",
       "      <td>5.766294</td>\n",
       "      <td>10.458614</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              Theta 1   Theta 2    Theta 3\n",
       "SETOSA      30.291853 -8.404206 -12.313125\n",
       "VERSICOLOR  -2.858904  1.546523  -3.107221\n",
       "VIRGINICA  -45.349540  5.766294  10.458614"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Set up linear regression parameters.\n",
    "max_iterations = 1000  # Max number of gradient descent iterations.\n",
    "regularization_param = 0  # Helps to fight model overfitting.\n",
    "polynomial_degree = 0  # The degree of additional polynomial features.\n",
    "sinusoid_degree = 0  # The degree of sinusoid parameter multipliers of additional features.\n",
    "\n",
    "# Init logistic regression instance.\n",
    "logistic_regression = LogisticRegression(x_train, y_train, polynomial_degree, sinusoid_degree)\n",
    "\n",
    "# Train logistic regression.\n",
    "(thetas, costs) = logistic_regression.train(regularization_param, max_iterations)\n",
    "\n",
    "# Print model parameters that have been learned.\n",
    "pd.DataFrame(thetas, columns=['Theta 1', 'Theta 2', 'Theta 3'], index=['SETOSA', 'VERSICOLOR', 'VIRGINICA'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Analyze Gradient Descent Progress\n",
    "\n",
    "The plot below illustrates how the cost function value changes over each iteration. You should see it decreasing. \n",
    "\n",
    "In case if cost function value increases it may mean that gradient descent missed the cost function minimum and with each step it goes further away from it.\n",
    "\n",
    "From this plot you may also get an understanding of how many iterations you need to get an optimal value of the cost function. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAELCAYAAAA2mZrgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzt3Xl8VOX1+PHPmUnCZCNhCSQhLBHCEhaDRlqrIi5QtRbUUgVtK9WKtl+sW92ta21darULv1ZcqlYLtbZW6oJFpQrWLWzKIrLIEvadhJBt5vz+mJtxEiYLITeTZM779ZpX5j73zr3nOpiT+9z7nEdUFWOMMQbAE+0AjDHGtB2WFIwxxoRYUjDGGBNiScEYY0yIJQVjjDEhlhSMMcaEuJoUROQsEVklImtE5JYI6x8VkSXO6wsR2edmPMYYYxombo1TEBEv8AUwFigGPgEmq+qKera/Ghipqpe5EpAxxphGuXmlMApYo6rrVLUSmAVMaGD7ycBMF+MxxhjTCDeTQi9gU9hysdN2GBHpC+QC77gYjzHGmEbERTsAxyTgJVX1R1opIlOBqQDJycnHDx48uDVjM8aYdm/hwoW7VDWjse3cTAqbgd5hyzlOWySTgP+rb0eqOgOYAVBYWKhFRUUtFaMxxsQEEdnQlO3c7D76BMgTkVwRSSD4i3923Y1EZDDQBfjAxViMMcY0gWtJQVWrgWnAm8BK4EVVXS4i94rI+LBNJwGz1Mq1GmNM1Ll6T0FVXwder9N2Z53lu92MwRhjTNO1lRvNxph2rKqqiuLiYsrLy6MdSszz+Xzk5OQQHx/frM9bUjDGHLXi4mJSU1Pp168fIhLtcGKWqrJ7926Ki4vJzc1t1j6s9pEx5qiVl5fTrVs3SwhRJiJ069btqK7YLCkYY1q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64NhGYjTmMJYUTLvkTOxyHnCqiHwpIh8TrBRZ3zzBLwCFIvIZ8APgc2c/i4C/AUuBNwiWWa97rEqCf3k/KCJLgSXANxoJcR6QX8+N5v7Au04siwle3fxDVXcD7zuPqT6sqv8B/gp84Gz7El8ljVUEJ1daCXQhOElMKvCqiHxKcJ7e6xuJ0ZjDWJVUY9oZp/voVedxVmNalF0pGGOMCbErBWOMMSF2pWCMMSbEkoIxxpgQSwrGGGNCLCkYY4wJsaRgjDEmxJKCMcaYkP8PkkkFTWmoSgUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Draw gradient descent progress for each label.\n",
    "labels = logistic_regression.unique_labels\n",
    "plt.plot(range(len(costs[0])), costs[0], label=labels[0])\n",
    "plt.plot(range(len(costs[1])), costs[1], label=labels[1])\n",
    "plt.plot(range(len(costs[2])), costs[2], label=labels[2])\n",
    "\n",
    "plt.xlabel('Gradient Steps')\n",
    "plt.ylabel('Cost')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Calculate Model Training Precision\n",
    "\n",
    "Calculate how many flowers from the training set have been guessed correctly. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Precision: 96.0000%\n"
     ]
    }
   ],
   "source": [
    "# Make training set predictions.\n",
    "y_train_predictions = logistic_regression.predict(x_train)\n",
    "\n",
    "# Check what percentage of them are actually correct.\n",
    "precision = np.sum(y_train_predictions == y_train) / y_train.shape[0] * 100\n",
    "\n",
    "print('Precision: {:5.4f}%'.format(precision))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Draw Decision Boundaries\n",
    "\n",
    "Let's build our decision boundaries. These are the lines that distinguish classes from each other. This will give us a pretty clear overview of how successfull our training process was. You should see clear distinguishment of three sectors on the data plain. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEXCAYAAACpuuMDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzs3Xd4VMXXwPHv7KYnJEACpNA7hBIgIp0o0gQBEQREKRbsWCkqKiIdRVD5vYqIiCJVFAQBFUERBKSE3kMgQKiB9Lo77x8bUjfJJluTzOd58iQ7O/fes4Hs2XvvnBkhpURRFEVR7tLYOwBFURTFsajEoCiKouSiEoOiKIqSi0oMiqIoSi4qMSiKoii5qMSgKIqi5KISg1LuCSGGCyF+s3cciuIoVGJQyjwhRKQQ4oGCnpdSLpNS9ijmPo8JIRIyv3RCiJQcj982P2pFsR8newegKPYkhHCSUmYUdzspZXCOfWwHvpdSLrJkbIpiL+qMQSlXhBCjhBA7hRCfCCFuAZMz2/7JfF5kPnddCBEnhDgihGhWzGO4CSHuCCGa5GgLEEIkCSF8hRAPZJ7FvCeEuCWEOC+EGJpn+7lCiCghxDUhxP+EEG6Zz1UVQvyauf8YIcTfFvrVKEoWlRiU8uheIAKoBkzL81wPoAvQEPABHgVuFWfnUsoUYBXweI7mx4AtUsq7+6oOVAACgaeAxUKI+pnPzQHqAC2ABkBt4J3M58Zlxl4F8AcmFSc2RTGFSgxKeXRFSvmZlDJDSpmc57l0DG/YjQEhpTwhpYwuwTG+BR4TQojMx08A3+V4Xg+8L6VMlVL+CWwGBgshNMAzwKtSyttSyjhgBnD3jCIdQzKpKaVMk1KqMwbF4lRiUMqjqIKeyHyT/hxYAFwXQiwUQngX9wBSyp1ABtAp81JUTWBjji63pJRJOR5fwPCG7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OuEk8MzjnnKvl/THNtCsfRwi4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Get the number of training examples.\n",
    "num_examples = x_train.shape[0]\n",
    "\n",
    "# Set up how many calculations we want to do along every axis. \n",
    "samples = 150\n",
    "\n",
    "# Generate test ranges for x and y axis.\n",
    "x_min = np.min(x_train[:, 0])\n",
    "x_max = np.max(x_train[:, 0])\n",
    "\n",
    "y_min = np.min(x_train[:, 1])\n",
    "y_max = np.max(x_train[:, 1])\n",
    "\n",
    "X = np.linspace(x_min, x_max, samples)\n",
    "Y = np.linspace(y_min, y_max, samples)\n",
    "\n",
    "# z axis will contain our predictions. So let's get predictions for every pair of x and y.\n",
    "Z_setosa = np.zeros((samples, samples))\n",
    "Z_versicolor = np.zeros((samples, samples))\n",
    "Z_virginica = np.zeros((samples, samples))\n",
    "\n",
    "for x_index, x in enumerate(X):\n",
    "    for y_index, y in enumerate(Y):\n",
    "        data = np.array([[x, y]])\n",
    "        prediction = logistic_regression.predict(data)[0][0]\n",
    "        if prediction == 'SETOSA':\n",
    "            Z_setosa[x_index][y_index] = 1\n",
    "        elif prediction == 'VERSICOLOR':\n",
    "            Z_versicolor[x_index][y_index] = 1\n",
    "        elif prediction == 'VIRGINICA':\n",
    "            Z_virginica[x_index][y_index] = 1\n",
    "\n",
    "# Now, when we have x, y and z axes being setup and calculated we may print decision boundaries.\n",
    "for iris_type in iris_types:\n",
    "    plt.scatter(\n",
    "        x_train[(y_train == iris_type).flatten(), 0],\n",
    "        x_train[(y_train == iris_type).flatten(), 1],\n",
    "        label=iris_type\n",
    "    )\n",
    "\n",
    "plt.contour(X, Y, Z_setosa)\n",
    "plt.contour(X, Y, Z_versicolor)\n",
    "plt.contour(X, Y, Z_virginica)\n",
    "    \n",
    "plt.xlabel(x_axis + ' (cm)')\n",
    "plt.ylabel(y_axis + ' (cm)')\n",
    "plt.title('Iris Types')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
